package com.ihr360.job.core.entity;

import org.springframework.util.Assert;

public class JobInstance extends Entity implements javax.batch.runtime.JobInstance{

    private final String jobName;

    public JobInstance(Long id, String jobName) {
        super(id);
        Assert.hasLength(jobName);
        this.jobName = jobName;
    }

    /**
     * @return the job name. (Equivalent to getJob().getName())
     */
    @Override
    public String getJobName() {
        return jobName;
    }

    @Override
    public String toString() {
        return super.toString() + ", Job=[" + jobName + "]";
    }

    @Override
    public long getInstanceId() {
        return super.getId();
    }
}
